function tokenize(value,separator){
	return StringTokenize(value,separator,0,null);
}
//************************************************
//StringTokenize('a.b.c.d','.',0,null);
//返回由'a','b','c','d'组成的长度为4的数组
//************************************************
function StringTokenize(value,separator,level,ary) {
  var buffer = new String(value);
  if(ary==null)
	ary = new Array();
  var index = buffer.indexOf(separator);
  var z = buffer.substring(0,index);
  var x = buffer.substring(index+1);
  if(z=='')
  	z = '';
  
  ary[level] = z;

  if(x.indexOf(separator) != -1){
  	StringTokenize(x,separator,level+1,ary);
  }
  else{
  	//if(x != '')
	  ary[level+1]=x;
  }

  return ary;
}

//数字正则表达式
var re_num=/^\d+$/;
//浮点正则表达式
var re_float=/^\d*\.?\d+$/;
/**
 * 验证是否是合法的数字
 */
function isNum(num) {
  return (re_num.test(num));
}
/**
 * 验证是否是合法的浮点数字
 */
function isFloatNum(num) {
  return (re_float.test(num));
}

function FormatNum2(obj){
	var amt = obj.value;
	if(amt == null || amt == "")return "";
	amt = Math.round(amt * 100)/100;
	return amt;
}

function FormatNum4(obj){
	var amt = obj.value;
	if(amt == null || amt == "")return "";
	amt = Math.round(amt * 10000)/10000;
	return amt;
}